class PlayerEvent(object):
    
    def __init__(self, match_team, match_player, minute):
        self.match_team = match_team
        self.match_player = match_player
        self.minute = minute
    

class Goal(PlayerEvent):
    
    type = 'goal'
    
    def __str__(self):
        return '%s scores for %s at %d minutes' % (self.match_player.player,
                                                   self.match_team.team.name,
                                                   self.minute)


class EndOfGame(object):
    
    type = 'end_of_game'

    def __str__(self):
        return 'End of game'


class YellowCard(PlayerEvent):
    
    type = 'yellow_card'
    
    def __str__(self):
        return '%s receives a yellow card at %d minutes' % (self.match_player.player,
                                                            self.minute)


class RedCard(PlayerEvent):
    
    type = 'red_card'
    
    def __str__(self):
        return '%s receives a red card at %d minutes' % (self.match_player.player,
                                                         self.minute)
